﻿@page "/scheduler/readonly-events"

@using Syncfusion.Blazor.Schedule
@inherits SampleBaseComponent;

<SampleDescription>
    <p> This demo showcases how to make specific events on the Scheduler to be displayed in a read-only mode. The read-only events can be simply viewed and prevented from undergoing any edit actions.</p>
</SampleDescription>
<ActionDescription>
   <p> In this demo, the events that has occurred on the past hours from the current time are made as read-only and the CRUD actions has been prevented on it. This has been done by setting <code>true</code> to the <code>IsReadonly</code> field of past events. By doing so, the <code>aria-readonly</code> attribute gets added into the event element and differentiate it from the other normal events.  </p>
</ActionDescription>

<div class="col-lg-12 control-section">
    <div class="schedule-wrapper">
        <SfSchedule TValue="ScheduleData.ReadonlyEventsData" Width="100%" Height="650px">
            <ScheduleViews>
                <ScheduleView Option="View.Day"></ScheduleView>
                <ScheduleView Option="View.Week"></ScheduleView>
                <ScheduleView Option="View.WorkWeek"></ScheduleView>
                <ScheduleView MaxEventsPerRow="2" Option="View.Month"></ScheduleView>
            </ScheduleViews>
            <ScheduleEventSettings DataSource="@DataSource"></ScheduleEventSettings>
        </SfSchedule>
    </div>
</div>

@code{
    public List<ScheduleData.ReadonlyEventsData> DataSource = new ScheduleData().GetReadonlyEventsData();
}